package com.match.competition_sub.client;

import com.match.commonutils.Result;
import com.match.entity.Vo.UserRoleVo;
import com.match.entity.roleEntity.CompetitionRole;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author 芊薰
 */
@FeignClient(name = "service-role",fallback = MainClientImpl.class)
@Component
public interface MainClient {
    @ApiOperation("通过服务调用获得所有的Role")
    @GetMapping("/admin/competition_role/competition-role/getAllRole")
    public Result getAllRole();

    @ApiOperation("通过服务调用添加教师对应的角色信息")
    @PostMapping("/admin/competition_role/competition-user/userAddRole")
    public Result userAddRole(@RequestBody UserRoleVo userRoleVo);

    @ApiOperation("通过服务调用的到角色")
    @GetMapping("/admin/competition_role/competition-role/getOneRoleByQuery/{roleName}")
    public Result getOneRoleByQuery(@PathVariable(value = "roleName")String roleName);

    @ApiOperation("通过服务添加角色")
    @PostMapping("/admin/competition_role/competition-role/addRole")
    public Result addRole(@RequestBody CompetitionRole competitionRole);

}
